<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="bower_components/jquery/dist/jquery.js" ></script>
    <script src="bower_components/bootstrap/dist/js/bootstrap.js" ></script>
    <!--引入Vue-->
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <!--引入Axios-->
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
首页
</body>
<script>
    //jQuery提供的页面加载完毕之后的方法
    $(function () {
        //这个方法会携带令牌请求控制器来判断身份
        //在这之前先获得jwt令牌
        let token = window.localStorage.getItem("accessToken");
        console.log(token);

        //发送axios请求,请求中要包含token,以便拦截器解析
        axios({
            url:"http://localhost:9000/v1/home",
            method:"get",
            params:{
                accessToken:token
            }
        }).then(function (response) {
            //相应的内容时根据用户身份判断的首页路径
            //直接跳转这个路径即可
            location.href = response.data;
        })
    })
</script>
</html>